package com.example.service;

import com.example.dao.AdminDao;
import com.example.entity.Merchant;
import com.example.entity.User;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.expression.Lists;

import java.util.List;

@Service
@Transactional
public class AdminServiceImpl implements AdminService {

      private AdminDao adminDao;

      public AdminServiceImpl(AdminDao adminDao) {
            this.adminDao = adminDao;
      }

      @Override
      public List<User> findAll() {
            return  adminDao.findAll();
      }

      @Override
      public void deleteUser(Integer id) {
            adminDao.deleteUser(id);
      }

      @Override
      public List<Merchant> findAllMer() {
            return adminDao.findAllMer();
      }

      @Override
      public List<Merchant> findAllMenu() {
            return adminDao.findAllMenu();
      }
}
